package com.shujia.rpc;

import java.io.Serializable;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class Server implements Serializable {

    public static void main(String[] args) throws Exception {

        RMIQueryStatusImpl rmiQueryStatus = new RMIQueryStatusImpl();

        // 注册表创建
        LocateRegistry.createRegistry(8888);

        String RMI_URL = "rmi://localhost:8888/RHello";

        // 绑定远端对象到名字
        Naming.rebind(RMI_URL,rmiQueryStatus);

        System.out.println(">>>>>INFO:远程RMIQueryStatus对象绑定成功！");

    }
}
